package com.example.yjhmatch.controller;


import com.example.yjhmatch.service.TournamentService;
import com.yc.yjh.entity.Result;
import com.yc.yjh.entity.Tournaments;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("tour")
public class TournamentController {

    @Resource
    TournamentService tournamentService;

    @RequestMapping("/all")
    public Result selectAll(){
        final List<Tournaments> tournaments = tournamentService.selectAll();
        return Result.success("OK",tournaments);
    }
}
